package com.qiqv.controller;

import com.qiqv.dto.OrderDto;
import com.qiqv.dto.QiQvResult;
import com.qiqv.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author hjr
 * @version 1.0
 * @date 2023/12/9 14:06
 */
@RestController
@RequestMapping("order")
public class OrderController {

    @Resource
    private OrderService orderService;

    @GetMapping("getOrder")
    public QiQvResult getOrder(){
        System.out.println("进入了OrderController代理的getOrder方法");
        List<OrderDto> allOrders = orderService.getAllOrders();
        return QiQvResult.OK(allOrders);
    }
}
